//
//  LeftViewController.m
//  bluetooth
//
//  Created by 周季阳 on 15/6/17.
//  Copyright (c) 2015年 switch. All rights reserved.
//

#import "LeftViewController.h"
#import "WWSideslipViewController.h"
#import "UIViewAdditions.h"
#import "ScanTableViewCell.h"
#import "ActionViewController.h"
#import "SLideZoomMenuController.h"

@interface LeftViewController ()<UITableViewDataSource,UITableViewDelegate>
{

}
@property (nonatomic ,retain) UITableView *tableView;
@property (nonatomic ,retain) NSMutableArray *zArrayTitle;
@property (nonatomic ,retain) NSMutableArray *zArrayImage;
@end

@implementation LeftViewController
@synthesize tableView,zArrayImage,zArrayTitle;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        [self createrView];
        
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.navigationBarHidden=YES;

    [self.view setBackgroundColor:[self colorWithHexString:@"#F5F5F5"]];
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 78, 260, SCREEN_HEIGHT/2)];
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.backgroundColor =[UIColor clearColor];
    [self.view addSubview:self.tableView];
    
    zArrayTitle = [[NSMutableArray alloc]initWithObjects:@"售后",@"商城",@"个人中心",nil];
    //,@"菜单_06"
    zArrayImage = [[NSMutableArray alloc]initWithObjects:@"菜单_03",@"菜单_08",@"菜单_10",nil];
    
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    
    return [zArrayTitle count];
    
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 40;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    ScanTableViewCell *cell = [[ScanTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    
    cell.zTitle.text = [zArrayTitle objectAtIndex:indexPath.row];
    cell.zIconImageView.image = [UIImage imageNamed:[zArrayImage objectAtIndex:indexPath.row]];
    
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.backgroundColor = [UIColor clearColor];
    return cell;
    
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0) {
        [[NSUserDefaults standardUserDefaults]setObject:@"0" forKey:@"switchPush"];
        [[NSNotificationCenter defaultCenter]postNotificationName:@"zhuan" object:nil];
    }else if(indexPath.row == 1){
        [[NSUserDefaults standardUserDefaults]setObject:@"1" forKey:@"switchPush"];
        [[NSNotificationCenter defaultCenter]postNotificationName:@"zhuan" object:nil];
    }else if (indexPath.row == 2){
        [[NSUserDefaults standardUserDefaults]setObject:@"2" forKey:@"switchPush"];
        [[NSNotificationCenter defaultCenter]postNotificationName:@"zhuan" object:nil];

    }
}

#pragma mark 实现传值协议方法
static int i = 100;
-(void)info:(float)sign{
    //NSLog(@"values:::%2f",sign);
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)createrView{
  
}

@end
